//导入request.js请求工具
import request from '@/utils/request.js'

// ==================== 首页相关接口 ====================

// 获取轮播图列表
export const getCarouselImagesService = () => {
  return request.get('/public/carousel');
}

// 获取首页新闻列表
export const getHomeNewsService = (limit = 5) => {
  return request.get('/public/news', {
    params: {
      limit
    }
  });
}

// 获取首页通知列表
export const getHomeNotificationsService = (limit = 5) => {
  return request.get('/public/notifications', {
    params: {
      limit
    }
  });
}

// ==================== 列表页面接口 ====================

// 获取所有赛事列表
export const getAllEventsService = () => {
  return request.get('/adminUser/events', {
    params: {
      status: 1, // 只获取已发布的赛事
      page: 1,
      size: 1000 // 获取大量数据
    }
  });
}

// 获取所有通知列表
export const getAllNotificationsService = () => {
  return request.get('/adminUser/system-notifications', {
    params: {
      status: 1, // 只获取已发布的通知
      page: 1,
      size: 1000 // 获取大量数据
    }
  });
}

// 获取所有新闻列表
export const getAllNewsService = () => {
  return request.get('/adminUser/news', {
    params: {
      status: 1, // 只获取已发布的新闻
      page: 1,
      size: 1000 // 获取大量数据
    }
  });
}

// ==================== 详情页面接口 ====================

// 获取赛事详情
export const getEventDetailService = (id) => {
  return request.get(`/adminUser/events/${id}`);
}

// 获取通知详情
export const getNotificationDetailService = (id) => {
  return request.get(`/adminUser/system-notifications/${id}`);
}

// 获取新闻详情
export const getNewsDetailService = (id) => {
  return request.get(`/adminUser/news/${id}`);
}
